package demo1;

public class Animal {
    public String name;
    public int age;

    static{
        System.out.println("Animal的静态代码块...");
    }

    {
        System.out.println("Animal的实例代码块...");
    }

    public Animal(){
        System.out.println("父类不带参数的构造方法执行完成...");
    }

    public Animal(String name, int age){
        this.name = name;
        this.age = age;
        System.out.println("父类带两个参数的构造方法执行完成...");
    }

    public void eat(){
        System.out.println(this.name + "正在吃饭...");
    }
}
